/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2017-07-21 11:42:21
 * @Copyright: 2017 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
package com.itttq.gshop.pbpm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.itttq.gshop.domain.po.SmsPlatformPo;
import com.itttq.gshop.domain.to.ResultPageTo;
import com.itttq.gshop.pbpm.mapper.ISmsPlatformMapper;

@Service
public class SmsPlatformService {
	@Autowired
	private ISmsPlatformMapper smsPlatformMapper;
	
	/**
	 * 根据ID获取SmsPlatformPo对象
	 * 
	 * @param id
	 * @return
	 * @Author 迷蝶
	 * @return SmsPlatformPo
	 */
	public SmsPlatformPo getSmsPlatform(int id) {
		return smsPlatformMapper.findSmsPlatformById(id);
	}
	
	/**
	 * 根据条件获取SmsPlatformPo对象，并返回查询的数据总数
	 * 
	 * @param smsPlatform
	 * @Author 迷蝶
	 * @return ResultPageTo<SmsPlatformPo>
	 */
	public ResultPageTo<SmsPlatformPo> getSmsPlatforms(SmsPlatformPo smsPlatform) {
		return new ResultPageTo<SmsPlatformPo>(smsPlatform.getStart(), smsPlatform.getSize(), 
				smsPlatformMapper.findSmsPlatformCount(smsPlatform), smsPlatformMapper.findSmsPlatforms(smsPlatform));
	}
	
	/**
	 * 根据ID删除SmsPlatformPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 */
	public Integer delSmsPlatform(int id) {
		return smsPlatformMapper.delSmsPlatformById(id);
	}
	
	/**
	 * 增加SmsPlatformPo对象
	 * 
	 * @param smsPlatform
	 * @Author 迷蝶
	 */
	public Integer addSmsPlatform(SmsPlatformPo smsPlatform) {
		return smsPlatformMapper.addSmsPlatform(smsPlatform);
	}
	
	/**
	 * 根据条件更新SmsPlatformPo对象
	 * 
	 * @param smsPlatform
	 * @Author 迷蝶
	 */
	public Integer updateSmsPlatform(SmsPlatformPo smsPlatform) {
		return smsPlatformMapper.updateSmsPlatform(smsPlatform);
	}
	
}
